package com.gpagers.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.baidu.ueditor.ActionEnter;



public class UeditorServlet extends HttpServlet{

	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setCharacterEncoding( "utf-8" );
		resp.setHeader("Content-Type" , "text/html");
		ServletContext application = this.getServletContext();
		String rootPath = application.getRealPath( "/" );
		PrintWriter out = resp.getWriter();
		out.write( new ActionEnter( req, rootPath ).exec() );
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}

}
